tm    = 1;
ss    = 2;
im_15 = 3;
im_lv = 4;
im_13 = 5;
rc2   = 6;
rc4   = 7;
xl    = 8;
xl160 = 9;
xl640 = 10;
mips20kc = 11;
mips24kc = 12;

%            tm   ss   im_15 im_lv im_13 rc2   rc4   xl   xl160 xl640 mips20kc mips24kc
tech      = [0.09 0.18 0.15  0.15  0.13  0.18  0.18  0.18 0.18  0.18  0.13     0.18]; % um
area      = [8.08 0    256.0 256.0 192.3 25    29    18.0 14.7  24.6  20.0     10.7]; % mm^2

%                      32b   32b   32b
energyo   = [0    0    587   423   328   0     0     0    0     0     0        0]; % pJ/op
energyw   = [0.82 16.7 0     0     0     0     0     0    0     0     0        0]; % mW/MHz

energyo(energyo==0) = energyw(energyo==0)*1000;
energyw(energyw==0) = energyo(energyw==0)/1000;

speed     = [350  600  132   66    150   24    24    24   24    24    533      261];

speed18   = (tech./0.18) .* speed;
energyw18 = (0.18./tech).^3 .* energyw;

rgb2yuv = 1;
seg = 2;
rle = 3;
label = 4;
ball = 5;
field = 6;
yellow = 7;
blue = 8;
robot = 9;

%            tm   ss   im_15 im_lv im_13 rc2   rc4   xl   xl160 xl640 mips20kc mips24kc
mtime     = [8    10.3 0     5.89  2.59  0.4   0.26  0.72 0     0     0        0;
             13.8 11.1 0     23.79 10.46 2.92  1.44  5.62 0     0     0        0;
             6.91 6    0     0     0     0     0     0    0     0     0        0;
             4.54 3.3  0     0     0     0     0     0    0     0     0        0;
             0.91 0.8  0     0     0     0     0     0    0     0     0        0;
             0.68 0.6  0     0     0     0     0     0    0     0     0        0;
             1.7  1.6  0     0     0     0     0     0    0     0     0        0;
             0.43 0.3  0     0     0     0     0     0    0     0     0        0;
             0.63 0.2  0     0     0     0     0     0    0     0     0        0];

%            tm   ss   im_15 im_lv im_13 rc2   rc4   xl   xl160 xl640 mips20kc mips24kc
mjoule    = [0    0    0     0     0     0.023 0.024 0.02 0     0     0        0;
             0    0    0     0     0     1.32  1.44  1.12 0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0;
             0    0    0     0     0     0     0     0    0     0     0        0];

calcen = repmat((energyw .* speed), [9 1]) .* (mtime/1000);
mjoule(mjoule==0) = calcen(mjoule==0);

mtime18  = repmat((speed./speed18), [9 1]) .* mtime;
mjoule18 = repmat((energyw18./energyw), [9 1]) .* mjoule;
